﻿using ZYCommon;
using System;
using System.Windows.Forms;

namespace TextEditor
{
    

    public class A_UnderWriteMarkUI : A_Action
    {
        public override string ActionName()
        {
            return "underwritemarkui";
        }

        public override bool Execute()
        {
            if (base.myOwnerDocument.Marks.AddMark(base.myOwnerDocument.SaveLogs.CurrentUserName, base.Param1) == null)
            {
                MessageBox.Show(null, "签名失败!", "签名", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return false;
            }
            return true;
        }

        public override bool isEnable()
        {
            return (base.myOwnerDocument.CanModify() && base.isEnable());
        }

        public override bool UIExecute()
        {
            string strData = dlgInputBox.InputBox("当前用户为[" + base.myOwnerDocument.SaveLogs.CurrentUserName + "],请输入审核人的名称", "文档签名", "");
            if (!StringCommon.isBlankString(strData))
            {
                base.Param1 = strData;
                return this.Execute();
            }
            return false;
        }
    }
}

